home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / ContourPlot / README
Text File  |  1994-05-17  |  5KB  |  104 lines

  1.  
  2. ContourPlot.app demonstrates the use of object class ContourView, but
  3. at the same time it tries to be a usable application for generating
  4. contour plots WITH COLOR FILLS from 2-dimensional grid data.
  5. While I have seen many contour plot routines and programs that produce
  6. contour lines in color, I could not find any that could FILL regions
  7. inside contour paths.  Hence, the ContourView class and this application.
  8. It can only handle 2-D data on a regularly spaced Cartesian grid.
  9.  
  10. ContourPlot reads 2-D grid data files in a simple ASCII format which
  11. may be generated easily by other programs.  See the Info/Help Panel
  12. and a sample data file for details of the file format.
  13.  
  14. * Press  File -> Open Sample File on the menu for a demo plot.
  15.  
  16. * Press  File -> View Sample File on the menu to look at the data
  17.   file that generates the demo plot.
  18.  
  19. Plots may be copied to the pasteboard as EPS (Encapsulated PostScript)
  20. by clicking the plot area once and pressing  Edit ->  Copy on the menu.
  21. Then, the plot may be pasted into documents that accept PostScript
  22. data, such as NeXTMail Compose window (In NeXTMail mode), Edit document
  23. (in RTF mode), ohter drawing/layout apps. 
  24.  
  25. To save to an EPS file, first paste into a Yap (or my BBFig)
  26. (/NextDeveloper/Apps/Yap.app) document, then save from Yap.
  27.  
  28.  
  29.  
  30.  
  31.  
  32. From ContourView README.
  33. -------------------------------------------------------------------------------------
  34.      Distinguishing features of this ContourView class are:
  35.      [1] It does color fills within contours just like colored geological maps.
  36.      As far as I am aware, this is the only public domain source code that can
  37.      do this for PostScript, not as bitmaps. (Let me know if you know of
  38.      any other PD code that does color-filled contour plots.)
  39.      [2] It is a pretty self contained object in the form of a View subclass.
  40.      [3] PostScript may be copied onto pasteboard and pasted into other apps that
  41.      accept EPS data.  Try pasting it into Yap document, NeXTmail compose
  42.      window, Edit RTFD document, etc.
  43.  
  44.      There is really no documentation.  Look at the class implementation file
  45.      ContourView.m and an example test application ContourPlotApp.m for usage
  46.      information.  The app included here is just for testing ContourView
  47.      class.  ContourView is meant to be included in your apps like any other
  48.      objects.
  49.  
  50.      It is pretty easy to use.  If instantiated within IB, all you need to do
  51.      to get a plot is to call the following two method to get a default
  52.      plot.  If you understand the following method, you can use the
  53.      ContourView object easily.
  54.  
  55.      - setCartesianGridData:(float *)f :(float)xmin :(float)xmax
  56.                   :(float)ymin :(float)ymax
  57.                   ofSize:(int)nx :(int)ny
  58.                   withInterpolationTo:(int)n1x :(int)n1y;
  59.  
  60.     f[nx*ny] is a 1-d array containing 2-d grid data such that f[iy*nx+ix]
  61.     contains the value at (ix, iy).
  62.     Typicall, just 3 messages below will produce a contour plot with color
  63.     fills.
  64.  
  65.     [contourView setCartesianGridData: fdata :1.0 :5.0 :1.0 :5.0
  66.                 ofSize: 20 :20
  67.                 withInterpolationTo: 50 :50];
  68.     [contourView setFillEnable:YES];
  69.     [contourView display];
  70.  
  71.     -------------------------------------------------------------------------------
  72.     TO USE:
  73.     ContourView class consists of the following modules/files.  Other files are
  74.     the glue needed for the test application ContourPlot.app.  When incorporating
  75.     ContourView into your app, you need to copy only the follwoing to your
  76.     project directory:
  77.  
  78.     ContourView.h
  79.     ContourView.m        (Class implementation)
  80.     computeContour.m    (contour path computation engine)
  81.     contour.h
  82.     sortContour.c        (sorting of contour path based on inclusion relation)
  83.     splin2.c        (bicubic spiline)
  84.     splin2.h
  85.  
  86.     -------------------------------------------------------------------------------
  87.  
  88.     This can use a lot more optimizations which should speed up the drawing
  89.     significantly.  Some of these are:
  90.     [1] All parameter changes currently trigger recomputation of all contour paths,
  91.     because almost everything is done in drawSelf:: method.
  92.     This should not be necessary for some.  E.g., changing fill colors, line
  93.     width etc should not cause recomputation of contour paths.
  94.     [2] Use DoUserPath() etc to optimize drawing.
  95.     [3] Some methods are not yet implemented (It does what I wanted now).
  96.     -------------------------------------------------------------------------------
  97.     Send comments, bug reports, suggestions and improvements to below:
  98.  
  99. ---
  100. Izumi Ohzawa, Ph.D.            [ $@Bg_78^=;(J ]
  101. USMail: University of California, 360 Minor Hall, Berkeley, CA 94720
  102. Telephone: (510) 642-6440     Fax:  (510) 642-3323
  103. Internet: izumi@pinoko.berkeley.edu (NeXT Mail OK)
  104.